//
//  BNDOfficeDocReadListView.m
//  OfficeDoc
//
//  Created by pie on 2022/4/5.
//  Copyright © 2022 pie. All rights reserved.
//

#import "BNDOfficeDocReadListView.h"
#import "BNDReadListHelper.h"
#import "BNDOfficeDocKit.h"

@interface BNDOfficeDocReadListView ()
@property (strong, nonatomic) UITableView *tableView;
@property (strong, nonatomic) BNDReadListHelper *helper;
@end

@implementation BNDOfficeDocReadListView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = UIColorWithHex(0xF6F6F8);
        [self addSubview:self.tableView];
        
    
        [_tableView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.mas_equalTo(UIEdgeInsetsZero);
        }];

    }
    
    return self;
}

- (void)setType:(NSInteger)type
{
    _type = type;
    self.helper.type = type ;
}

- (void)setAnnouncementId:(NSString *)announcementId
{
    _announcementId = announcementId;
    self.helper.announcementId = announcementId ;
}

- (BNDReadListHelper*)helper
{
    if(!_helper){
        _helper = [[BNDReadListHelper alloc] initWith:_tableView];
    }
    return _helper;
}


- (UITableView*)tableView
{
    if(!_tableView){
        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height) style:UITableViewStylePlain];
        _tableView.backgroundColor = UIColor.whiteColor;
        _tableView.separatorStyle= UITableViewCellSeparatorStyleNone;
    }
    return _tableView;
}

@end
